/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-03-28     admin       the first version
 */
#ifndef APPLICATIONS_THAISENPOWERCONTROL_H_
#define APPLICATIONS_THAISENPOWERCONTROL_H_


#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include "stm32f4xx_hal.h"
#include "thaisen7102Public.h"

#include "thaisenChargModuleLib.h"
#include "thaisenChargModule.h"

void thaisen_PowerControl_init(struct thasienPowerControlSetStruct *powerS);
void thaisen_set_powercontrol_open_close(uint8_t sta,uint8_t gunNum, uint8_t ChargeState, uint16_t BatVolt);
void thaisen_set_powercontrol_volt_curr(uint32_t volt,uint32_t curr,uint8_t group,uint8_t gunNum);
void thaisen_set_terminal_status(uint8_t gunNum,uint8_t connectstatus,uint8_t scram,uint8_t gate,uint8_t water);
void thaisen_set_terminal_data(uint8_t gunNum,uint16_t outputvolt,uint16_t outputcurr,uint16_t outputpower,uint16_t chargetime);
void thaisen_send_heartbeat_powercontrol_broadcast(uint8_t groupNum);
void*  thaisen_getpowercontrol_state(uint8_t gunNum,uint8_t Sequence);
void thaisen_powercontrol_process(void);
void thaisen_set_powercontrol_address(void);
void thaisen_set_powercontrol_group(void);
void thaisen_read_powercontrol_volt_curr_group(uint8_t groupNum);
uint32_t thaisen_get_powercontrol_volt(uint8_t gunNum);
void thaisen_read_powercontrol_status_group(uint8_t groupNum);
void* thaisen_get_powercontrol_voltage_current(uint8_t groupNum, uint8_t Sequence);
time_t mw_get_current_timestamp(void);

#endif /* APPLICATIONS_THAISENYINENG_H_ */
